program Factorial;
var a, b : integer;
function fact (var x : integer) : integer;
begin
b := b + 1;
if x = 0 then
fact := 1
else
fact := x * fact(x-1)
end;
begin
read(a);
b := 0;
a := fact(a);
write(a);
write(b)
end.
